feat(datasource): mars-style date matching#168
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for “MARS-style” date rule strings in datasource match.date configuration (single/list/range/stepped-range), alongside existing old-style relative comparisons.
Changes:
- Implement MARS date token parsing plus list/range(/by step) expansion and matching logic in
date_check. - Add unit tests covering token parsing, expansion, rule matching, and
date_checkOR/AND semantics. - Update the documented JSON schema descriptions/examples for date matching rules.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
polytope_server/common/datasource/date_check.py |
Adds MARS-style parsing/expansion/matching and updates date_check logic to support OR-matching across multiple MARS rules. |
tests/unit/test_date_check.py |
New unit test suite for MARS-style date parsing/matching and old-style compatibility. |
docs/source/schemas/schema.json |
Updates match/date documentation and expands schema typing for match values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Description
Add the ability to set date match rules with mars date strings (lists, ranges without "by"), e.g.
Where the request dates must match
one ofthe rule strings. Ranges in requests can only match ranges in rules (to avoid having to expand the whole range)Contributor Declaration
By opening this pull request, I affirm the following: